package com.smart4s.app.core.positionservice.presenter;


import com.smart4s.app.core.positionservice.base.BasePresenter;
import com.smart4s.app.core.positionservice.contract.Contracts;
import com.smart4s.app.core.positionservice.model.ModelImpl;

import java.util.Map;

/**
 * Created by Android Studio.
 * User: 潘世松
 * Date: 2019/12/27
 * Time: 14:45
 */
public class PresenterImpl extends BasePresenter {

    private ModelImpl model;

    @Override
    protected void initModel() {
        model = new ModelImpl();
    }

    @Override
    public void startPost(String url, Map<String, Object> map, Class cla) {
        model.onPostInfo(url, map, cla, new Contracts.MyCallBack() {
            @Override
            public void onSuccess(Object o) {
                getView().onSuccess(o);
            }

            @Override
            public void onError(String error) {
                getView().onError(error);
            }
        });
    }
}
